<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('志愿者评价信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <!--    条件搜索模块-->
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
<!--                            <li>-->
<!--                                <p>状态：</p>-->
<!--                                <select name="appraiseState" th:with="type=${@dict.getType('activity_appraise_state')}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"-->
<!--                                            th:value="${dict.dictValue}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
                            <li class="select-time">
                                <p>反馈提交时间：</p>
                                <input type="text" class="time-input" id="startTime" style="width: 133px" placeholder="请选择开始时间" name="beginDate"/>
                                <span>至</span>
                                <input type="text" class="time-input" id="endTime" style="width: 133px" placeholder="请选择结束时间" name="endDate"/>
                            </li>
                            <li>
                                <a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <!--    展示表格模块-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table">
                    <thead>
                        <tr>
                            <th data-formatter="fm_rowIndex" data-align="center">序号</th>
                            <th data-field="volunteerId">志愿者编号</th>
                            <th data-field="volunteerName">姓名</th>
                            <th data-field="activityId">活动编号</th>
                            <th data-field="activityName">活动名称</th>
                            <th data-field="appraiseContent">评价内容</th>
                            <th data-field="createTime">提交时间</th>
<!--                            <th data-field="appraiseState" data-formatter="fm_state">状态</th>-->
                            <th data-formatter="fm_commands" data-width="120px" data-align="center">操作</th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        /** 一些数据的初始化 */
        //  编辑按钮标志
        var editFlag = [[${@permission.hasPermi('vtsp:appraise:edit')}]];
        //  删除按钮标志
        var removeFlag = [[${@permission.hasPermi('vtsp:appraise:remove')}]];
        //  请求路径访问前缀
        var prefix = ctx + "vtsp/activity_appraise";

        //  初始化函数
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "志愿者评价信息",
                uniqueId: "appraiseId"
            };
            $.table.init(options);
        });

        /** 字典功能 */
        //  状态字典数据
        let state_dict = [[${@dict.getType('activity_appraise_state')}]];
        //  根据字典的学院格式转化器
        function fm_state(value, row ,index) {
            return $.table.selectDictLabel(state_dict, value);
        }
        
        //命令  
        function fm_commands(value, row, index){
            var actions = [];
            // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.appraiseId + '\')"><i class="fa"></i>处理</a> ');
            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.appraiseId + '\')"><i class="fa"></i>删除</a>');
            return actions.join('');
        }
    </script>
</body>
</html>